package com.algo.generator.constant;

import com.algo.generator.common.ICodeMSG;

/**
 * ResponseCodeEnum 存储相对通用的response code
 */
public enum ResponseCodeEnum implements ICodeMSG {

    SUCCESS(0, "处理成功"),
    FAIL(-1, "处理失败"), //未知错误
    NotAuthenticated(401, "未授权访问或授权码过期，请重新登录后再继续操作"),

    INVALID_PARAMETER(418, "参数错误");

    private final int code;
    private final String message;

    ResponseCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
